Skir is a declarative language for defining data types, constants, and APIs. Write your schema once in a .skir file and generate idiomatic, type-safe code in TypeScript, Python, Java, Go, C++, and more.
One YAML file. One command.
No manual reruns: watch mode refreshes generated code on every change.
Zero-install compiler (npx), easy to integrate into any workflow.
// shapes.skir
struct Shape {
points: [Point];
/// A short string describing this shape.
label: string;
}
struct Point {
x: int32;
y: int32;
label: string;
}
method IsConvex(
Shape
): bool = 412938;import { ServiceClient } from "skir-client";
// Import from file generated by Skir
import { IsConvex, Shape } from "../skirout/shapes.js";
// Construct an immutable Shape
const triangle = Shape.create({
points: [
{ x: 0, y: 0, label: "A" },
{ x: 10, y: 0, label: "B" },
{ x: 0, y: 10, label: "C" },
],
label: "ABC",
});
// Demonstrate round-trip serialization
const restored = Shape.serializer.fromJson(
Shape.serializer.toJson(triangle)
);
console.log(restored.label); // ABC
// Send RPC
const isConvex = await new ServiceClient(
"http://localhost:8080/api"
).invokeRemote(IsConvex, triangle);
console.log(isConvex); // trueModifying schemas in a long-lived or distributed system is risky—one wrong move can break clients or make it impossible to deserialize old data.
Skir has simple guidelines and built-in checks to evolve your schema safely.
SkirRPC is a lightweight HTTP protocol for typesafe cross-service or frontend↔backend communication. It integrates with your existing web framework. Your client and server use the same generated method definitions, so contract mismatches are caught before runtime.
Every SkirRPC service ships with a built-in Studio app for browsing and testing its methods.
Choose between dense JSON for web APIs and databases, readable JSON for debugging, or binary for raw performance.
Don't copy files. Import types directly from any GitHub repository. Share common data structures across projects.
Skir enums have variants. Each variant can be a simple constant or carry typed data, giving you a clean way to model polymorphism.
Except in C++, Skir generates deeply immutable types with all fields required at construction time.
Define constants in your .skir files. They ship in generated code, so services share the same values without runtime config reads.
Skir schemas can be serialized and deserialized as JSON. This enables generic tools, like the Studio app, to understand schema structure.
The array type allows you to specify a key field, e.g. [User|user_id]. On the wire, this is just like an array, but the generated code will give you fast key-based lookups.
A powerful VS Code extension and LSP with all the features you need. Real-time validation, code completion, automatic code formatting and more.
Code generators are regular NPM modules, so you can add custom ones without hacking the compiler.
Set up your first Skir project in minutes. Manage your entire project configuration from a single YAML file.